import QtQuick 1.0

Item {
  
 width: 500
 height: 300 
 
 Component {
      id: inlinecomponent
      Rectangle {
	  //width: 100
	  //height: 100
	  //color: Qt::rgba(0.5, 0.5, 0, 1)
	  border.color: "black"
	  border.width: activeFocus? 5 : 0
	  radius: 10
      }
  }
  
  function radomInterval(min,max){
    return min + (max-min)*Math.random();
  }
  
  NavigationView {
      id : navId
      anchors.fill : parent
  }
  
  MouseArea {
      anchors.fill : parent
      onClicked : {
	  console.log('creation item');
	  var it = inlinecomponent.createObject(navId.contentItem);
	  
	  it.x=radomInterval(10,1200);
	  it.y=radomInterval(10,800);
	  it.width=radomInterval(50,500);
	  it.height=radomInterval(50,500);
	  it.color = Qt.rgba(Math.random(),Math.random(),Math.random(), 1);
	  
      }
  }
    
  
  
}